package tk.zater.CS;

import java.util.HashMap;

import org.aspectj.weaver.patterns.ThisOrTargetAnnotationPointcut;
import org.springframework.beans.factory.annotation.Autowired;

public class UserAccountManagermant {
	@Autowired
public static HashMap<String, String>userAccount;

	public HashMap<String, String> getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(HashMap<String, String> userAccount) {
		this.userAccount = userAccount;
	}
	
	public static String[] getAccount(){
		if(userAccount.size()!=0){
	
		String username=userAccount.keySet().iterator().next();
	
		return new String[]{username,userAccount.get(username)};
		}else{
			throw new NullPointerException("do not have enough Account");
		}
	}
	public static void removeAccount(String Username){
		
			userAccount.remove(Username);
		
		
	}
}
